﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using System.IO;
using System.Web;
using System.Threading.Tasks;
using System.Data;
using BartonExtension;
using ResponseObject;
using SQLWrapper;
using Model.App;
using Model.Images;
using Model.Weixin;
using Services.Common;
using Services.User;

namespace iShangMai.Controllers
{
    public class QueryController : ApiController
    {
        [HttpPost]
        public async Task<ZKResponse> SearchWithQuery(ISMQueryUserRequest request)
        {
            ZKResponse response = new ZKResponse();
            ISMUserServiceProvider provider = (ISMUserServiceProvider)ISMServiceStack.sharedInstance[ISMServiceStackKeys.USER];
            ISMServiceModel model = new ISMServiceModel()
            {
                operationIdentifier = ISMUserServiceProvider.USER_QUERY,
                userinfo = request
            };

            ISMServiceResult result = await provider.doProcess(model);
            response.isProcessSuccess = result.isOperationSuccess;
            response.errMsg = result.errorMsg;
            response.userinfo = result.dbReturningState;
            return response;
        }
    }
}
